<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
<title>职位管理</title>
<style>
.viewjob .content-module.first {
    border-top: none;
}
.viewjob .content-module {
    border-top: 1px solid #DDD;
    clear: both;
    font-size: 13px;
    overflow: hidden;
    padding: 20px 10px;
}
</style>
<script>
    $(document).ready(function() {
      $('.apply').click(function() {
        $('#actionForm').attr('action', '${ctx}/member/application/post').submit();
      });
      $('.bookmark').click(function() {
        $('#actionForm').attr('action', '${ctx}/member/bookmark/save/position').submit();
      });
    });
</script>
</head>

<body>
  <c:if test="${not empty message}">
    <div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
  </c:if>
  <div class="row">
    <div class="span8 viewjob">
      <div class="row well">
        <div class="span5">
          <div>
            <div>${position.name}</div>
            <div><a href="${ctx}/jobsearch/company/${position.company.id}">${position.company.name}</a></div>
          </div>
        </div>
        <div class="span2">
          <img src="${ctx}/static/images/company/${position.company.avatar.imagePath}"/>
        </div>
      </div>
      <div class="content-module first">
        <div><strong>职位信息</strong></div>
        <div><strong>工作地点：</strong>${position.provinceName} - ${position.cityName}</div>
        <div><strong>招聘人数：</strong>${position.count}</div>
        <div><strong>工作年限：</strong>${position.workingYearsName}</div>
        <div><strong>发布日期：</strong><fmt:formatDate value="${position.refreshDate}" type="date"/></div>
        <div style="padding-top: 20px">${position.description}</div>
      </div>
      <div class="content-module">
        <div><strong>语言要求：</strong>${position.languageName}</div>
        <div><strong>学历：</strong>${position.educationName}</div>
      </div>
      <div class="content-module">
        <div><strong>公司信息</strong></div>
        <div><strong>公司行业：</strong>${position.company.industry.name}</div>
        <div><strong>公司性质：</strong>${position.company.typeName}</div>
        <div><strong>公司规模：</strong>${position.company.sizeName}</div>
      </div>
      <div class="content-module">
        <button class="apply" type="submit">立刻申请</button>
      </div>
    </div>
    <div class="span4">
        <div class="well">
          <div class="row" style="padding-bottom:20px">
            <div class="span3">
                <button class="apply">立刻申请</button>
            </div>
            <div class="span1"></div>
          </div>
          <div style="background:url('${ctx}/static/images/icon_save_job_16x15.png') 2px 0 no-repeat; padding-left:26px">
            <a href="javascript:void(0);" class="bookmark">收藏职位</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">查看已收藏职位 >></a>
          </div>
          <div style="background:url('${ctx}/static/images/sprite_cmpfollow_v1.png') 0 -81px no-repeat; padding-left:26px">
            <a href="javascript:void(0);" class="bookmark-company">收藏公司</a>
          </div>
        </div>
        <div class="well">
          <div>推荐给你的朋友</div>
          <div style="padding-top:20px">
            <img style="padding-left:20px" src="${ctx}/static/images/avatar/ghost_person_60x60_v1.png"></img>
            <img style="padding-left:20px" src="${ctx}/static/images/avatar/ghost_person_60x60_v1.png"></img>
            <img style="padding-left:20px" src="${ctx}/static/images/avatar/ghost_person_60x60_v1.png"></img>
          </div>
        </div>
        <div class="well">
          <div>该公司其他职位</div>
          <div style="padding-top:20px">
            <c:forEach items="${sameCompanyPositions}" var="sameCompanyPosition">
            <div><a href="${ctx}/jobsearch/position/${sameCompanyPosition.id}">${sameCompanyPosition.name}</a></div>
            </c:forEach>
          </div>
        </div>
        <div class="well">
          <div>同类职位</div>
          <div style="padding-top:20px">
            <div><a href="#">产品经理1</a></div>
            <div><a href="#">产品经理2</a></div>
            <div><a href="#">产品经理3</a></div>
          </div>
        </div>
    </div>
  </div>
  <form id="actionForm" class="form-inline form-horizontal" method="post">
      <input type="hidden" name="pid" value="${position.id}"/>
  </form>
</body>
</html>
